package com.xyw.code.study202007292;

import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.internal.util.StringUtils;
import com.taobao.api.request.TbkDgMaterialOptionalRequest;
import com.taobao.api.request.TbkDgNewuserOrderGetRequest;
import com.taobao.api.request.TbkShopGetRequest;
import com.taobao.api.response.TbkDgMaterialOptionalResponse;
import com.taobao.api.response.TbkDgNewuserOrderGetResponse;
import com.taobao.api.response.TbkShopGetResponse;

/**
 * Created with IntelliJ IDEA.
 * User: xuyiwei
 * Date: 2020/8/4
 * Time: 下午10:29
 * Email: 1328312923@qq.com
 * Description: No Description
 **/
public class aaa {
    public static void main(String[] args) throws ApiException {
//        TaobaoClient client = new DefaultTaobaoClient("http://gw.api.taobao.com/router/rest",
//                "30949218", "4ce31c58f2b5f5db98b5f4e4420f2d77");
//        TbkDgMaterialOptionalRequest req = new TbkDgMaterialOptionalRequest();
//
//        req.setQ("fu至内容€GBgac0xdYuk€咑幵\uD83D\uDC49τao寶\uD83D\uDC48或點击炼接https://m.tb.cn/h.VGIQVoW?sm=ccec75 至浏.览览.器【Cartier卡地亚 经典款签名戒指 18K玫瑰金 铂金单钻情侣对戒 婚戒】");
//        req.setAdzoneId(110672450081L);
//
//        TbkDgMaterialOptionalResponse rsp = client.execute(req);
//        System.out.println(rsp.getBody());

        TaobaoClient client = new DefaultTaobaoClient("http://gw.api.taobao.com/router/rest",
                "30949218", "4ce31c58f2b5f5db98b5f4e4420f2d77");
        TbkDgNewuserOrderGetRequest req = new TbkDgNewuserOrderGetRequest();
        req.setPageSize(20L);
        req.setAdzoneId(110672450081L);
        req.setPageNo(0L);
        req.setStartTime(StringUtils.parseDateTime("2018-01-24 00:34:05"));
        req.setEndTime(StringUtils.parseDateTime("2021-01-24 00:34:05"));
        req.setActivityId("119013_2");
        TbkDgNewuserOrderGetResponse rsp = client.execute(req);
        System.out.println(rsp.getBody());

    }
}
